﻿namespace HuaWei
{
    using DevExpress.Utils;
    using DevExpress.XtraEditors;
    using DevExpress.XtraEditors.Controls;
    using DevExpress.XtraEditors.Mask;
    using DevExpress.XtraEditors.Repository;
    using DevExpress.XtraGrid;
    using DevExpress.XtraGrid.Columns;
    using DevExpress.XtraGrid.Views.Base;
    using DevExpress.XtraGrid.Views.Grid;
    using DevExpress.XtraTreeList;
    using DevExpress.XtraTreeList.Columns;
    using HuaWei.CommClass;
    using HuaWei.CommComp;
    using HuaWei.Common;
    using HuaWei.Windows.Forms;
    using System;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Windows.Forms;

    public class FrmJLSP : FrmBase
    {
        private BindingSource bindingSource;
        private BindingSource bindingSource1;
        private BindingSource bindingSource2;
        private BindingSource bindingSource3;
        private BindingSource bindingSource4;
        private BindingSource bindingSource5;
        private SimpleButton btnDel;
        private SimpleButton btnZXQ;
        private ComboBoxEdit cboSPJT;
        private GridColumn colBL;
        private GridColumn colBQJLS;
        private TreeListColumn colbqmjlje;
        private TreeListColumn colbqmjls;
        private GridColumn colBW;
        private TreeListColumn colCBMC;
        private GridColumn colDW;
        private TreeListColumn colHTJE;
        private TreeListColumn colHTSL;
        private TreeListColumn colID;
        private GridColumn colJLCT;
        private GridColumn colJSBL;
        private GridColumn colMC;
        private GridColumn colPZBH;
        private GridColumn colQDBH;
        private TreeListColumn colQDBH1;
        private TreeListColumn colQDDW;
        private GridColumn colQDMC;
        private GridColumn colQQZH;
        private TreeListColumn colsgtje;
        private TreeListColumn colsgtsl;
        private GridColumn colSL;
        private GridColumn colTYSB;
        private GridColumn colTZBH;
        private TreeListColumn colwcbl;
        private TreeListColumn colZBDJ;
        private ButtonEdit edtQDBH;
        private GridControl grdSPQK;
        private GridColumn gridColumn;
        private GridColumn gridColumn4;
        private GridColumn gridColumn5;
        private GridControl gridControl1;
        private GridControl gridControl2;
        private GridControl gridControl3;
        private GridView gridView1;
        private GridView gridView2;
        private GridView gridView3;
        private GroupControl groupControl1;
        private GroupControl groupControl2;
        private GroupControl groupControl3;
        private SimpleButton HqeQbQlxEb;
        private IContainer icontainer1 = null;
        private LabelControl labelControl1;
        private LabelControl labelControl5;
        private GridView onypCxUys;
        private PanelControl panelControl3;
        private PanelControl panelControl4;
        private PanelControl panelControl5;
        private RadioGroup radioGroup;
        private RepositoryItemCheckEdit repositoryItemCheckEdit1;
        private RepositoryItemCheckEdit repositoryItemCheckEdit2;
        private RepositoryItemComboBox repositoryItemComboBox2;
        private RepositoryItemImageComboBox repositoryItemImageComboBox2;
        private RepositoryItemLookUpEdit repositoryItemLookUpEdit1;
        private RepositoryItemLookUpEdit repositoryItemLookUpEdit2;
        private RepositoryItemTextEdit repositoryItemTextEdit1;
        private RepositoryItemTextEdit repositoryItemTextEdit2;
        private SplitterControl splitterControl1;
        private SplitterControl splitterControl2;
        private TextEdit textEdit1;
        private TreeList trJLQD;
        private GridColumn ylcQheaGue;

        public FrmJLSP()
        {
            this.InitializeComponent();
        }

        private void bindingSource2_PositionChanged(object sender, EventArgs e)
        {
            this.method16();
        }

        private void bindingSource3_PositionChanged(object sender, EventArgs e)
        {
            this.method14("");
            this.method15();
        }

        private void btnDel_Click(object sender, EventArgs e)
        {
            this.method1(1);
        }

        private void btnZXQ_Click(object sender, EventArgs e)
        {
            this.method1(2);
        }

        private void cboSPJT_SelectedIndexChanged(object sender, EventArgs e)
        {
            int num = this.cboSPJT.SelectedIndex;
            if (num == 1)
            {
                num = -1;
            }
            this.method10(num);
        }

        public override void ControlFormStatus()
        {
            this.btnDel.Enabled = true;
            if (!GParams.QCInfo.QCZT.Equals(-1))
            {
                DevCCHelp.ControlForm(base.Controls, true, 2);
                this.btnDel.Enabled = false;
            }
            else if (!DHelp.GetObjValue(this.bindingSource2, "TYSB", true).Equals("1"))
            {
                DevCCHelp.ControlForm(base.Controls, false, 1);
            }
            else
            {
                DevCCHelp.ControlForm(base.Controls, true, 1);
            }
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.icontainer1 != null))
            {
                this.icontainer1.Dispose();
            }
            base.Dispose(disposing);
        }

        private void edtQDBH_ButtonClick(object sender, ButtonPressedEventArgs e)
        {
            this.edtQDBH.Text = "";
            this.method12("");
        }

        private void edtQDBH_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == '\r')
            {
                this.method12(this.edtQDBH.Text);
            }
        }

        private void FrmJLSP_Load(object sender, EventArgs e)
        {
            this.method4();
            this.LoadData();
        }

        private void gridView1_CustomDrawCell(object sender, RowCellCustomDrawEventArgs e)
        {
            if (e.Column.FieldName.Equals("BL"))
            {
                DataRow dataRow = this.gridView1.GetDataRow(e.RowHandle);
                if (dataRow["xh"].Equals(-3) || dataRow["xh"].Equals(-1))
                {
                    e.Appearance.ForeColor = e.Appearance.BackColor;
                }
            }
        }

        private void gridView1_RowCellStyle(object sender, RowCellStyleEventArgs e)
        {
            Class28.smethod11(this.gridView1, e);
        }

        private void gridView2_DoubleClick(object sender, EventArgs e)
        {
            this.method8();
        }

        private void HqeQbQlxEb_Click(object sender, EventArgs e)
        {
            string str = AppDomain.CurrentDomain.BaseDirectory + @"DCFile\";
            if (Class37.smethod1().JLExpDelJLData(str + GParams._BDName + "-" + GParams.QCInfo.QCID + "期-审批删除的数据.txt"))
            {
                MsgBox.ShowMsg("导出删除日志已完成!");
            }
        }

        private void InitializeComponent()
        {
            this.icontainer1 = new Container();
            this.groupControl1 = new GroupControl();
            this.trJLQD = new TreeList();
            this.colID = new TreeListColumn();
            this.colQDBH1 = new TreeListColumn();
            this.colCBMC = new TreeListColumn();
            this.colHTSL = new TreeListColumn();
            this.colsgtsl = new TreeListColumn();
            this.colZBDJ = new TreeListColumn();
            this.colHTJE = new TreeListColumn();
            this.colsgtje = new TreeListColumn();
            this.colQDDW = new TreeListColumn();
            this.colbqmjls = new TreeListColumn();
            this.colbqmjlje = new TreeListColumn();
            this.colwcbl = new TreeListColumn();
            this.bindingSource = new BindingSource(this.icontainer1);
            this.repositoryItemImageComboBox2 = new RepositoryItemImageComboBox();
            this.radioGroup = new RadioGroup();
            this.panelControl4 = new PanelControl();
            this.gridControl1 = new GridControl();
            this.bindingSource3 = new BindingSource(this.icontainer1);
            this.onypCxUys = new GridView();
            this.colQDBH = new GridColumn();
            this.colQDMC = new GridColumn();
            this.colDW = new GridColumn();
            this.colBQJLS = new GridColumn();
            this.repositoryItemTextEdit2 = new RepositoryItemTextEdit();
            this.splitterControl2 = new SplitterControl();
            this.gridControl3 = new GridControl();
            this.bindingSource2 = new BindingSource(this.icontainer1);
            this.gridView2 = new GridView();
            this.colPZBH = new GridColumn();
            this.colQQZH = new GridColumn();
            this.colTZBH = new GridColumn();
            this.colBW = new GridColumn();
            this.gridColumn = new GridColumn();
            this.colJLCT = new GridColumn();
            this.colJSBL = new GridColumn();
            this.ylcQheaGue = new GridColumn();
            this.repositoryItemLookUpEdit1 = new RepositoryItemLookUpEdit();
            this.colTYSB = new GridColumn();
            this.repositoryItemCheckEdit2 = new RepositoryItemCheckEdit();
            this.repositoryItemCheckEdit1 = new RepositoryItemCheckEdit();
            this.panelControl3 = new PanelControl();
            this.groupControl2 = new GroupControl();
            this.grdSPQK = new GridControl();
            this.bindingSource1 = new BindingSource(this.icontainer1);
            this.gridView1 = new GridView();
            this.colMC = new GridColumn();
            this.colSL = new GridColumn();
            this.colBL = new GridColumn();
            this.repositoryItemTextEdit1 = new RepositoryItemTextEdit();
            this.groupControl3 = new GroupControl();
            this.gridControl2 = new GridControl();
            this.bindingSource4 = new BindingSource(this.icontainer1);
            this.gridView3 = new GridView();
            this.gridColumn4 = new GridColumn();
            this.gridColumn5 = new GridColumn();
            this.panelControl5 = new PanelControl();
            this.HqeQbQlxEb = new SimpleButton();
            this.btnZXQ = new SimpleButton();
            this.btnDel = new SimpleButton();
            this.labelControl5 = new LabelControl();
            this.edtQDBH = new ButtonEdit();
            this.cboSPJT = new ComboBoxEdit();
            this.repositoryItemComboBox2 = new RepositoryItemComboBox();
            this.repositoryItemLookUpEdit2 = new RepositoryItemLookUpEdit();
            this.textEdit1 = new TextEdit();
            this.labelControl1 = new LabelControl();
            this.splitterControl1 = new SplitterControl();
            this.bindingSource5 = new BindingSource(this.icontainer1);
            base.ds.BeginInit();
            base.dsQuery.BeginInit();
            base.dataSets.BeginInit();
            this.groupControl1.BeginInit();
            this.groupControl1.SuspendLayout();
            this.trJLQD.BeginInit();
            ((ISupportInitialize)this.bindingSource).BeginInit();
            this.repositoryItemImageComboBox2.BeginInit();
            this.radioGroup.Properties.BeginInit();
            this.panelControl4.BeginInit();
            this.panelControl4.SuspendLayout();
            this.gridControl1.BeginInit();
            ((ISupportInitialize)this.bindingSource3).BeginInit();
            this.onypCxUys.BeginInit();
            this.repositoryItemTextEdit2.BeginInit();
            this.gridControl3.BeginInit();
            ((ISupportInitialize)this.bindingSource2).BeginInit();
            this.gridView2.BeginInit();
            this.repositoryItemLookUpEdit1.BeginInit();
            this.repositoryItemCheckEdit2.BeginInit();
            this.repositoryItemCheckEdit1.BeginInit();
            this.panelControl3.BeginInit();
            this.panelControl3.SuspendLayout();
            this.groupControl2.BeginInit();
            this.groupControl2.SuspendLayout();
            this.grdSPQK.BeginInit();
            ((ISupportInitialize)this.bindingSource1).BeginInit();
            this.gridView1.BeginInit();
            this.repositoryItemTextEdit1.BeginInit();
            this.groupControl3.BeginInit();
            this.groupControl3.SuspendLayout();
            this.gridControl2.BeginInit();
            ((ISupportInitialize)this.bindingSource4).BeginInit();
            this.gridView3.BeginInit();
            this.panelControl5.BeginInit();
            this.panelControl5.SuspendLayout();
            this.edtQDBH.Properties.BeginInit();
            this.cboSPJT.Properties.BeginInit();
            this.repositoryItemComboBox2.BeginInit();
            this.repositoryItemLookUpEdit2.BeginInit();
            this.textEdit1.Properties.BeginInit();
            ((ISupportInitialize)this.bindingSource5).BeginInit();
            base.SuspendLayout();
            this.groupControl1.Controls.Add(this.trJLQD);
            this.groupControl1.Controls.Add(this.radioGroup);
            this.groupControl1.Dock = DockStyle.Left;
            this.groupControl1.Location = new Point(0, 0);
            this.groupControl1.Name = "groupControl1";
            this.groupControl1.Size = new Size(0x181, 0x22b);
            this.groupControl1.TabIndex = 10;
            this.groupControl1.Text = "计量清单信息";
            this.trJLQD.Columns.AddRange(new TreeListColumn[] { this.colID, this.colQDBH1, this.colCBMC, this.colHTSL, this.colsgtsl, this.colZBDJ, this.colHTJE, this.colsgtje, this.colQDDW, this.colbqmjls, this.colbqmjlje, this.colwcbl });
            this.trJLQD.DataSource = this.bindingSource;
            this.trJLQD.Dock = DockStyle.Fill;
            this.trJLQD.ImageIndexFieldName = "QDLX";
            this.trJLQD.Location = new Point(2, 0x38);
            this.trJLQD.Name = "trJLQD";
            this.trJLQD.OptionsBehavior.Editable = false;
            this.trJLQD.OptionsView.AutoWidth = false;
            this.trJLQD.OptionsView.ShowButtons = true;
            this.trJLQD.OptionsView.ShowIndicator = false;
            this.trJLQD.ParentFieldName = "PID";
            this.trJLQD.PreviewFieldName = "QDMC";
            this.trJLQD.RepositoryItems.AddRange(new RepositoryItem[] { this.repositoryItemImageComboBox2 });
            this.trJLQD.Size = new Size(0x17d, 0x1f1);
            this.trJLQD.TabIndex = 0;
            this.trJLQD.TreeLineStyle = LineStyle.None;
            this.trJLQD.CustomDrawNodeCell += new CustomDrawNodeCellEventHandler(this.trJLQD_CustomDrawNodeCell);
            this.trJLQD.DoubleClick += new EventHandler(this.trJLQD_DoubleClick);
            this.colID.FieldName = "ID";
            this.colID.Name = "colID";
            this.colQDBH1.Caption = "编号";
            this.colQDBH1.FieldName = "QDBH";
            this.colQDBH1.Name = "colQDBH1";
            this.colQDBH1.Visible = true;
            this.colQDBH1.VisibleIndex = 0;
            this.colQDBH1.Width = 0x35;
            this.colCBMC.Caption = "清单名称";
            this.colCBMC.FieldName = "QDMC";
            this.colCBMC.Name = "colCBMC";
            this.colCBMC.Visible = true;
            this.colCBMC.VisibleIndex = 1;
            this.colCBMC.Width = 0x6f;
            this.colHTSL.Caption = "合同量";
            this.colHTSL.FieldName = "HTSL";
            this.colHTSL.Name = "colHTSL";
            this.colHTSL.Visible = true;
            this.colHTSL.VisibleIndex = 2;
            this.colHTSL.Width = 0x2e;
            this.colsgtsl.Caption = "施工图数量";
            this.colsgtsl.FieldName = "SGTSL";
            this.colsgtsl.Name = "colsgtsl";
            this.colsgtsl.Visible = true;
            this.colsgtsl.VisibleIndex = 3;
            this.colZBDJ.Caption = "合同价";
            this.colZBDJ.FieldName = "ZBDJ";
            this.colZBDJ.Name = "colZBDJ";
            this.colZBDJ.Visible = true;
            this.colZBDJ.VisibleIndex = 4;
            this.colZBDJ.Width = 0x30;
            this.colHTJE.Caption = "合同额";
            this.colHTJE.FieldName = "HTJE";
            this.colHTJE.Name = "colHTJE";
            this.colHTJE.Visible = true;
            this.colHTJE.VisibleIndex = 5;
            this.colHTJE.Width = 0x43;
            this.colsgtje.Caption = "施工图金额";
            this.colsgtje.FieldName = "SGTJE";
            this.colsgtje.Name = "colsgtje";
            this.colsgtje.Visible = true;
            this.colsgtje.VisibleIndex = 6;
            this.colQDDW.Caption = "单位";
            this.colQDDW.FieldName = "DW";
            this.colQDDW.Name = "colQDDW";
            this.colQDDW.Visible = true;
            this.colQDDW.VisibleIndex = 7;
            this.colQDDW.Width = 0x24;
            this.colbqmjls.Caption = "已完成量";
            this.colbqmjls.FieldName = "bqmjls";
            this.colbqmjls.Name = "colbqmjls";
            this.colbqmjls.Visible = true;
            this.colbqmjls.VisibleIndex = 8;
            this.colbqmjls.Width = 0x3b;
            this.colbqmjlje.Caption = "已完成额";
            this.colbqmjlje.FieldName = "bqmjlje";
            this.colbqmjlje.Name = "colbqmjlje";
            this.colbqmjlje.Visible = true;
            this.colbqmjlje.VisibleIndex = 9;
            this.colbqmjlje.Width = 0x3b;
            this.colwcbl.Caption = "完成比%";
            this.colwcbl.FieldName = "bl";
            this.colwcbl.Name = "colwcbl";
            this.colwcbl.Visible = true;
            this.colwcbl.VisibleIndex = 10;
            this.colwcbl.Width = 0x3a;
            this.bindingSource.DataMember = "JLQD";
            this.repositoryItemImageComboBox2.Name = "repositoryItemImageComboBox2";
            this.radioGroup.Dock = DockStyle.Top;
            this.radioGroup.Location = new Point(2, 0x17);
            this.radioGroup.Name = "radQDSelc";
            this.radioGroup.Properties.Columns = 2;
            this.radioGroup.Properties.Items.AddRange(new RadioGroupItem[] { new RadioGroupItem(null, "本期清单"), new RadioGroupItem(null, "全部清单") });
            this.radioGroup.RightToLeft = System.Windows.Forms.RightToLeft.No;
            this.radioGroup.Size = new Size(0x17d, 0x21);
            this.radioGroup.TabIndex = 1;
            this.radioGroup.SelectedIndexChanged += new EventHandler(this.radioGroup_SelectedIndexChanged);
            this.panelControl4.Controls.Add(this.gridControl1);
            this.panelControl4.Controls.Add(this.splitterControl2);
            this.panelControl4.Controls.Add(this.gridControl3);
            this.panelControl4.Controls.Add(this.panelControl3);
            this.panelControl4.Controls.Add(this.panelControl5);
            this.panelControl4.Dock = DockStyle.Fill;
            this.panelControl4.Location = new Point(0x187, 0);
            this.panelControl4.Name = "panelControl4";
            this.panelControl4.Size = new Size(0x2bd, 0x22b);
            this.panelControl4.TabIndex = 13;
            this.gridControl1.DataMember = null;
            this.gridControl1.DataSource = this.bindingSource3;
            this.gridControl1.Dock = DockStyle.Fill;
            this.gridControl1.EmbeddedNavigator.Buttons.Edit.Visible = false;
            this.gridControl1.Location = new Point(2, 0xa7);
            this.gridControl1.MainView = this.onypCxUys;
            this.gridControl1.Name = "gridControl1";
            this.gridControl1.RepositoryItems.AddRange(new RepositoryItem[] { this.repositoryItemTextEdit2 });
            this.gridControl1.Size = new Size(0x1db, 0x182);
            this.gridControl1.TabIndex = 0x16;
            this.gridControl1.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { this.onypCxUys });
            this.bindingSource3.DataMember = "QDJL_MX";
            this.bindingSource3.DataSource = base.dataSets;
            this.bindingSource3.PositionChanged += new EventHandler(this.bindingSource3_PositionChanged);
            this.onypCxUys.Columns.AddRange(new GridColumn[] { this.colQDBH, this.colQDMC, this.colDW, this.colBQJLS });
            this.onypCxUys.GridControl = this.gridControl1;
            this.onypCxUys.Name = "grdJLMX";
            this.onypCxUys.OptionsCustomization.AllowFilter = false;
            this.onypCxUys.OptionsCustomization.AllowGroup = false;
            this.onypCxUys.OptionsCustomization.AllowSort = false;
            this.onypCxUys.OptionsNavigation.EnterMoveNextColumn = true;
            this.onypCxUys.OptionsView.ColumnAutoWidth = false;
            this.onypCxUys.OptionsView.ShowGroupPanel = false;
            this.onypCxUys.OptionsView.ShowIndicator = false;
            this.colQDBH.Caption = "清单编号";
            this.colQDBH.FieldName = "QDBH";
            this.colQDBH.Name = "colQDBH";
            this.colQDBH.Visible = true;
            this.colQDBH.VisibleIndex = 0;
            this.colQDBH.Width = 0x67;
            this.colQDMC.Caption = "项目名称";
            this.colQDMC.FieldName = "QDMC";
            this.colQDMC.Name = "colQDMC";
            this.colQDMC.Visible = true;
            this.colQDMC.VisibleIndex = 1;
            this.colQDMC.Width = 0xd5;
            this.colDW.Caption = "单位";
            this.colDW.FieldName = "DW";
            this.colDW.Name = "colDW";
            this.colDW.Visible = true;
            this.colDW.VisibleIndex = 2;
            this.colDW.Width = 0x34;
            this.colBQJLS.Caption = "本期计量数";
            this.colBQJLS.ColumnEdit = this.repositoryItemTextEdit2;
            this.colBQJLS.FieldName = "BQJLS";
            this.colBQJLS.Name = "colBQJLS";
            this.colBQJLS.Visible = true;
            this.colBQJLS.VisibleIndex = 3;
            this.colBQJLS.Width = 0x48;
            this.repositoryItemTextEdit2.AutoHeight = false;
            this.repositoryItemTextEdit2.Mask.EditMask = "n3";
            this.repositoryItemTextEdit2.Mask.MaskType = MaskType.Numeric;
            this.repositoryItemTextEdit2.Name = "repositoryItemTextEdit2";
            this.repositoryItemTextEdit2.Spin += repositoryItemTextEdit2_Spin;
            this.splitterControl2.Dock = DockStyle.Top;
            this.splitterControl2.Location = new Point(2, 0xa1);
            this.splitterControl2.Name = "splitterControl2";
            this.splitterControl2.Size = new Size(0x1db, 6);
            this.splitterControl2.TabIndex = 0x17;
            this.splitterControl2.TabStop = false;
            this.gridControl3.DataMember = null;
            this.gridControl3.DataSource = this.bindingSource2;
            this.gridControl3.Dock = DockStyle.Top;
            this.gridControl3.EmbeddedNavigator.Buttons.Edit.Visible = false;
            this.gridControl3.Location = new Point(2, 0x1b);
            this.gridControl3.MainView = this.gridView2;
            this.gridControl3.Name = "gridControl3";
            this.gridControl3.RepositoryItems.AddRange(new RepositoryItem[] { this.repositoryItemCheckEdit1, this.repositoryItemLookUpEdit1, this.repositoryItemCheckEdit2 });
            this.gridControl3.Size = new Size(0x1db, 0x86);
            this.gridControl3.TabIndex = 0x18;
            this.gridControl3.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { this.gridView2 });
            this.bindingSource2.DataMember = "QDJL_M";
            this.bindingSource2.DataSource = base.dataSets;
            this.bindingSource2.PositionChanged += new EventHandler(this.bindingSource2_PositionChanged);
            this.gridView2.Columns.AddRange(new GridColumn[] { this.colPZBH, this.colQQZH, this.colTZBH, this.colBW, this.gridColumn, this.colJLCT, this.colJSBL, this.ylcQheaGue, this.colTYSB });
            this.gridView2.GridControl = this.gridControl3;
            this.gridView2.Name = "gridView2";
            this.gridView2.OptionsCustomization.AllowFilter = false;
            this.gridView2.OptionsCustomization.AllowGroup = false;
            this.gridView2.OptionsCustomization.AllowSort = false;
            this.gridView2.OptionsNavigation.EnterMoveNextColumn = true;
            this.gridView2.OptionsView.ColumnAutoWidth = false;
            this.gridView2.OptionsView.ShowGroupPanel = false;
            this.gridView2.OptionsView.ShowIndicator = false;
            this.gridView2.DoubleClick += new EventHandler(this.gridView2_DoubleClick);
            this.colPZBH.Caption = "凭证编号";
            this.colPZBH.FieldName = "PZBH";
            this.colPZBH.Name = "colPZBH";
            this.colPZBH.OptionsColumn.AllowEdit = false;
            this.colPZBH.Visible = true;
            this.colPZBH.VisibleIndex = 0;
            this.colPZBH.Width = 0x42;
            this.colQQZH.Caption = "起讫桩号";
            this.colQQZH.FieldName = "QQZH";
            this.colQQZH.Name = "colQQZH";
            this.colQQZH.OptionsColumn.AllowEdit = false;
            this.colQQZH.Visible = true;
            this.colQQZH.VisibleIndex = 1;
            this.colQQZH.Width = 180;
            this.colTZBH.Caption = "图纸编号";
            this.colTZBH.FieldName = "TZBH";
            this.colTZBH.Name = "colTZBH";
            this.colTZBH.OptionsColumn.AllowEdit = false;
            this.colTZBH.Visible = true;
            this.colTZBH.VisibleIndex = 2;
            this.colTZBH.Width = 0x45;
            this.colBW.Caption = "部位";
            this.colBW.FieldName = "BW";
            this.colBW.Name = "colBW";
            this.colBW.OptionsColumn.AllowEdit = false;
            this.colBW.Visible = true;
            this.colBW.VisibleIndex = 3;
            this.colBW.Width = 100;
            this.gridColumn.Caption = "中间交工证书编号";
            this.gridColumn.FieldName = "ZJJGZSBH";
            this.gridColumn.Name = "colZJJGZSBH";
            this.gridColumn.OptionsColumn.AllowEdit = false;
            this.gridColumn.Visible = true;
            this.gridColumn.VisibleIndex = 4;
            this.gridColumn.Width = 0x6c;
            this.colJLCT.Caption = "计量草图及几何尺寸";
            this.colJLCT.FieldName = "JLCT";
            this.colJLCT.Name = "colJLCT";
            this.colJLCT.OptionsColumn.AllowEdit = false;
            this.colJLCT.Width = 20;
            this.colJSBL.Caption = "计算变量";
            this.colJSBL.FieldName = "JSBL";
            this.colJSBL.Name = "colJSBL";
            this.colJSBL.OptionsColumn.AllowEdit = false;
            this.colJSBL.Width = 60;
            this.ylcQheaGue.Caption = "审批状态";
            this.ylcQheaGue.ColumnEdit = this.repositoryItemLookUpEdit1;
            this.ylcQheaGue.FieldName = "SPZT";
            this.ylcQheaGue.Name = "colSPZT";
            this.ylcQheaGue.Tag = "-1";
            this.ylcQheaGue.Visible = true;
            this.ylcQheaGue.VisibleIndex = 6;
            this.ylcQheaGue.Width = 60;
            this.repositoryItemLookUpEdit1.AutoHeight = false;
            this.repositoryItemLookUpEdit1.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.repositoryItemLookUpEdit1.Columns.AddRange(new LookUpColumnInfo[] { new LookUpColumnInfo("Code", "Code", 20, FormatType.None, "", false, HorzAlignment.Default), new LookUpColumnInfo("value", "value") });
            this.repositoryItemLookUpEdit1.DropDownRows = 2;
            this.repositoryItemLookUpEdit1.Name = "repositoryItemLookUpEdit1";
            this.repositoryItemLookUpEdit1.NullText = "";
            this.repositoryItemLookUpEdit1.PopupFormMinSize = new Size(10, 0);
            this.repositoryItemLookUpEdit1.ShowFooter = false;
            this.repositoryItemLookUpEdit1.ShowHeader = false;
            this.colTYSB.Caption = "同意上报";
            this.colTYSB.ColumnEdit = this.repositoryItemCheckEdit2;
            this.colTYSB.FieldName = "TYSB";
            this.colTYSB.Name = "colTYSB";
            this.colTYSB.Tag = "-1";
            this.colTYSB.Width = 60;
            this.repositoryItemCheckEdit2.AutoHeight = false;
            this.repositoryItemCheckEdit2.Name = "repositoryItemCheckEdit2";
            this.repositoryItemCheckEdit2.ValueChecked = 1;
            this.repositoryItemCheckEdit2.ValueUnchecked = 0;
            this.repositoryItemCheckEdit1.DisplayValueChecked = "1";
            this.repositoryItemCheckEdit1.DisplayValueUnchecked = "0";
            this.repositoryItemCheckEdit1.Name = "repositoryItemCheckEdit1";
            this.repositoryItemCheckEdit1.NullStyle = StyleIndeterminate.Unchecked;
            this.repositoryItemCheckEdit1.ValueChecked = (short)1;
            this.repositoryItemCheckEdit1.ValueUnchecked = (short)0;
            this.panelControl3.Controls.Add(this.groupControl2);
            this.panelControl3.Controls.Add(this.groupControl3);
            this.panelControl3.Dock = DockStyle.Right;
            this.panelControl3.Location = new Point(0x1dd, 0x1b);
            this.panelControl3.Name = "panelControl3";
            this.panelControl3.Size = new Size(0xde, 0x20e);
            this.panelControl3.TabIndex = 13;
            this.groupControl2.Controls.Add(this.grdSPQK);
            this.groupControl2.Dock = DockStyle.Fill;
            this.groupControl2.Location = new Point(2, 2);
            this.groupControl2.Name = "groupControl2";
            this.groupControl2.Size = new Size(0xda, 0x167);
            this.groupControl2.TabIndex = 3;
            this.groupControl2.Text = "详细信息";
            this.grdSPQK.DataMember = null;
            this.grdSPQK.DataSource = this.bindingSource1;
            this.grdSPQK.Dock = DockStyle.Fill;
            this.grdSPQK.Location = new Point(2, 0x17);
            this.grdSPQK.MainView = this.gridView1;
            this.grdSPQK.Name = "grdSPQK";
            this.grdSPQK.RepositoryItems.AddRange(new RepositoryItem[] { this.repositoryItemTextEdit1 });
            this.grdSPQK.Size = new Size(0xd6, 0x14e);
            this.grdSPQK.TabIndex = 3;
            this.grdSPQK.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { this.gridView1 });
            this.bindingSource1.DataMember = "JLQD";
            this.bindingSource1.DataSource = base.dataSets;
            this.gridView1.Columns.AddRange(new GridColumn[] { this.colMC, this.colSL, this.colBL });
            this.gridView1.GridControl = this.grdSPQK;
            this.gridView1.Name = "gridView1";
            this.gridView1.OptionsBehavior.ReadOnly = true;
            this.gridView1.OptionsView.ColumnAutoWidth = false;
            this.gridView1.OptionsView.ShowGroupPanel = false;
            this.gridView1.OptionsView.ShowHorzLines = false;
            this.gridView1.OptionsView.ShowIndicator = false;
            this.gridView1.OptionsView.ShowVertLines = false;
            this.gridView1.CustomDrawCell += new RowCellCustomDrawEventHandler(this.gridView1_CustomDrawCell);
            this.gridView1.RowCellStyle += new RowCellStyleEventHandler(this.gridView1_RowCellStyle);
            this.colMC.Caption = " ";
            this.colMC.FieldName = "MC";
            this.colMC.Name = "colMC";
            this.colMC.Visible = true;
            this.colMC.VisibleIndex = 0;
            this.colMC.Width = 0x53;
            this.colSL.Caption = "数量";
            this.colSL.FieldName = "SL";
            this.colSL.Name = "colSL";
            this.colSL.Visible = true;
            this.colSL.VisibleIndex = 1;
            this.colSL.Width = 0x3f;
            this.colBL.Caption = "占比%";
            this.colBL.ColumnEdit = this.repositoryItemTextEdit1;
            this.colBL.FieldName = "BL";
            this.colBL.Name = "colBL";
            this.colBL.Visible = true;
            this.colBL.VisibleIndex = 2;
            this.colBL.Width = 0x38;
            this.repositoryItemTextEdit1.AutoHeight = false;
            this.repositoryItemTextEdit1.DisplayFormat.FormatString = "0.00";
            this.repositoryItemTextEdit1.DisplayFormat.FormatType = FormatType.Numeric;
            this.repositoryItemTextEdit1.Name = "repositoryItemTextEdit1";
            this.groupControl3.Controls.Add(this.gridControl2);
            this.groupControl3.Dock = DockStyle.Bottom;
            this.groupControl3.Location = new Point(2, 0x169);
            this.groupControl3.Name = "groupControl3";
            this.groupControl3.Size = new Size(0xda, 0xa3);
            this.groupControl3.TabIndex = 4;
            this.groupControl3.Text = "过程数据";
            this.gridControl2.DataMember = null;
            this.gridControl2.DataSource = this.bindingSource4;
            this.gridControl2.Dock = DockStyle.Fill;
            this.gridControl2.Location = new Point(2, 0x17);
            this.gridControl2.MainView = this.gridView3;
            this.gridControl2.Name = "gridControl2";
            this.gridControl2.Size = new Size(0xd6, 0x8a);
            this.gridControl2.TabIndex = 4;
            this.gridControl2.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { this.gridView3 });
            this.gridView3.Columns.AddRange(new GridColumn[] { this.gridColumn4, this.gridColumn5 });
            this.gridView3.GridControl = this.gridControl2;
            this.gridView3.Name = "gridView3";
            this.gridView3.OptionsBehavior.ReadOnly = true;
            this.gridView3.OptionsView.ShowColumnHeaders = false;
            this.gridView3.OptionsView.ShowGroupPanel = false;
            this.gridView3.OptionsView.ShowIndicator = false;
            this.gridColumn4.Caption = " ";
            this.gridColumn4.FieldName = "mc";
            this.gridColumn4.Name = "gridColumn4";
            this.gridColumn4.Visible = true;
            this.gridColumn4.VisibleIndex = 0;
            this.gridColumn4.Width = 0x90;
            this.gridColumn5.Caption = " ";
            this.gridColumn5.FieldName = "sl";
            this.gridColumn5.Name = "gridColumn5";
            this.gridColumn5.Visible = true;
            this.gridColumn5.VisibleIndex = 1;
            this.gridColumn5.Width = 0x55;
            this.panelControl5.Controls.Add(this.HqeQbQlxEb);
            this.panelControl5.Controls.Add(this.btnZXQ);
            this.panelControl5.Controls.Add(this.btnDel);
            this.panelControl5.Controls.Add(this.labelControl5);
            this.panelControl5.Controls.Add(this.edtQDBH);
            this.panelControl5.Controls.Add(this.cboSPJT);
            this.panelControl5.Dock = DockStyle.Top;
            this.panelControl5.Location = new Point(2, 2);
            this.panelControl5.Name = "panelControl5";
            this.panelControl5.Size = new Size(0x2b9, 0x19);
            this.panelControl5.TabIndex = 0x15;
            this.HqeQbQlxEb.Dock = DockStyle.Left;
            this.HqeQbQlxEb.Location = new Point(0x151, 2);
            this.HqeQbQlxEb.Name = "simpleButton1";
            this.HqeQbQlxEb.Size = new Size(0x60, 0x15);
            this.HqeQbQlxEb.TabIndex = 12;
            this.HqeQbQlxEb.Tag = "-2";
            this.HqeQbQlxEb.Text = "导出已删除数据";
            this.HqeQbQlxEb.Click += new EventHandler(this.HqeQbQlxEb_Click);
            this.btnZXQ.Dock = DockStyle.Left;
            this.btnZXQ.Location = new Point(0x114, 2);
            this.btnZXQ.Name = "btnZXQ";
            this.btnZXQ.Size = new Size(0x3d, 0x15);
            this.btnZXQ.TabIndex = 11;
            this.btnZXQ.Tag = "-2";
            this.btnZXQ.Text = "转下期";
            this.btnZXQ.Visible = false;
            this.btnZXQ.Click += new EventHandler(this.btnZXQ_Click);
            this.btnDel.Dock = DockStyle.Left;
            this.btnDel.Location = new Point(0xd7, 2);
            this.btnDel.Name = "btnDel";
            this.btnDel.Size = new Size(0x3d, 0x15);
            this.btnDel.TabIndex = 10;
            this.btnDel.Tag = "-2";
            this.btnDel.Text = "删除";
            this.btnDel.Click += new EventHandler(this.btnDel_Click);
            this.labelControl5.Anchor = AnchorStyles.Left | AnchorStyles.Top;
            this.labelControl5.Location = new Point(440, 5);
            this.labelControl5.Name = "labelControl5";
            this.labelControl5.Size = new Size(0x18, 14);
            this.labelControl5.TabIndex = 8;
            this.labelControl5.Text = "批复";
            this.labelControl5.Visible = true;
            this.edtQDBH.Dock = DockStyle.Left;
            this.edtQDBH.Location = new Point(2, 2);
            this.edtQDBH.Name = "edtQDBH";
            this.edtQDBH.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Close) });
            this.edtQDBH.Size = new Size(0xd5, 0x15);
            this.edtQDBH.TabIndex = 7;
            this.edtQDBH.Tag = "-2";
            this.edtQDBH.ButtonClick += new ButtonPressedEventHandler(this.edtQDBH_ButtonClick);
            this.edtQDBH.KeyPress += new KeyPressEventHandler(this.edtQDBH_KeyPress);
            this.cboSPJT.Anchor = AnchorStyles.Left | AnchorStyles.Top;
            this.cboSPJT.Location = new Point(465, 2);
            this.cboSPJT.Name = "cboSPJT";
            this.cboSPJT.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.cboSPJT.Properties.Items.AddRange(new object[] { "通过", "" });
            this.cboSPJT.Size = new Size(100, 0x15);
            this.cboSPJT.TabIndex = 7;
            this.cboSPJT.Tag = "-1";
            this.cboSPJT.Visible = true;
            this.cboSPJT.SelectedIndexChanged += new EventHandler(this.cboSPJT_SelectedIndexChanged);
            this.repositoryItemComboBox2.AutoHeight = false;
            this.repositoryItemComboBox2.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.repositoryItemComboBox2.Name = "repositoryItemComboBox2";
            this.repositoryItemLookUpEdit2.AutoHeight = false;
            this.repositoryItemLookUpEdit2.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.repositoryItemLookUpEdit2.Columns.AddRange(new LookUpColumnInfo[] { new LookUpColumnInfo("code", "Name1", 20, FormatType.None, "", false, HorzAlignment.Default), new LookUpColumnInfo("value", 10, "Name2") });
            this.repositoryItemLookUpEdit2.Name = "repositoryItemLookUpEdit2";
            this.repositoryItemLookUpEdit2.PopupWidth = 20;
            this.repositoryItemLookUpEdit2.ShowHeader = false;
            this.textEdit1.Location = new Point(6, 0x22);
            this.textEdit1.Name = "textEdit1";
            this.textEdit1.Size = new Size(140, 0x15);
            this.textEdit1.TabIndex = 1;
            this.labelControl1.Location = new Point(6, 0x11);
            this.labelControl1.Name = "labelControl1";
            this.labelControl1.Size = new Size(0x18, 14);
            this.labelControl1.TabIndex = 0;
            this.splitterControl1.Location = new Point(0x181, 0);
            this.splitterControl1.Name = "splitterControl1";
            this.splitterControl1.Size = new Size(6, 0x22b);
            this.splitterControl1.TabIndex = 14;
            this.splitterControl1.TabStop = false;
            this.bindingSource5.DataMember = "QDJL_MX";
            this.bindingSource5.DataSource = base.dataSets;
            base.AutoScaleDimensions = new SizeF(6f, 12f);
            base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            base.ClientSize = new Size(0x444, 0x22b);
            base.Controls.Add(this.panelControl4);
            base.Controls.Add(this.splitterControl1);
            base.Controls.Add(this.groupControl1);
            base.Name = "FrmJLSP";
            this.Text = "计量审批";
            base.Load += new EventHandler(this.FrmJLSP_Load);
            base.ds.EndInit();
            base.dsQuery.EndInit();
            base.dataSets.EndInit();
            this.groupControl1.EndInit();
            this.groupControl1.ResumeLayout(false);
            this.trJLQD.EndInit();
            ((ISupportInitialize)this.bindingSource).EndInit();
            this.repositoryItemImageComboBox2.EndInit();
            this.radioGroup.Properties.EndInit();
            this.panelControl4.EndInit();
            this.panelControl4.ResumeLayout(false);
            this.gridControl1.EndInit();
            ((ISupportInitialize)this.bindingSource3).EndInit();
            this.onypCxUys.EndInit();
            this.repositoryItemTextEdit2.EndInit();
            this.gridControl3.EndInit();
            ((ISupportInitialize)this.bindingSource2).EndInit();
            this.gridView2.EndInit();
            this.repositoryItemLookUpEdit1.EndInit();
            this.repositoryItemCheckEdit2.EndInit();
            this.repositoryItemCheckEdit1.EndInit();
            this.panelControl3.EndInit();
            this.panelControl3.ResumeLayout(false);
            this.groupControl2.EndInit();
            this.groupControl2.ResumeLayout(false);
            this.grdSPQK.EndInit();
            ((ISupportInitialize)this.bindingSource1).EndInit();
            this.gridView1.EndInit();
            this.repositoryItemTextEdit1.EndInit();
            this.groupControl3.EndInit();
            this.groupControl3.ResumeLayout(false);
            this.gridControl2.EndInit();
            ((ISupportInitialize)this.bindingSource4).EndInit();
            this.gridView3.EndInit();
            this.panelControl5.EndInit();
            this.panelControl5.ResumeLayout(false);
            this.panelControl5.PerformLayout();
            this.edtQDBH.Properties.EndInit();
            this.cboSPJT.Properties.EndInit();
            this.repositoryItemComboBox2.EndInit();
            this.repositoryItemLookUpEdit2.EndInit();
            this.textEdit1.Properties.EndInit();
            ((ISupportInitialize)this.bindingSource5).EndInit();
            base.ResumeLayout(false);
        }

        void repositoryItemTextEdit2_Spin(object sender, SpinEventArgs e)
        {
            e.Handled = true;
        }

        public override void LoadedForm()
        {
            base.SetBindingSource(this.bindingSource2, "QDJL_M", false);
            base.SetBindingSource(this.bindingSource3, "QDJL_MX", false);
            base.SetBindingSource(this.bindingSource5, "QDJL_JSS", false);
            this.bindingSource1.DataSource = base.dsQuery.Tables["SPQK"];
            this.bindingSource1.Sort = "xh";
            base.ds.Tables["QDJL_MX"].ColumnChanging += new DataColumnChangeEventHandler(this.method3);
            base.ds.Tables["QDJL_M"].ColumnChanged += new DataColumnChangeEventHandler(this.method2);
            this.bindingSource4.DataSource = base.dsQuery.Tables["QDJL_MX2"];
            this.bindingSource3.PositionChanged += new EventHandler(this.bindingSource3_PositionChanged);
            this.bindingSource2.MoveFirst();
            this.method15();
        }

        public override void LoadingData()
        {
            base.LoadingData();
            QCInfo qCInfo = GParams.QCInfo;
            base.ds.Clear();
            base.dsQuery.Clear();
            this.method7();
            this.method5();
            this.method14("");
            this.bindingSource2.MoveFirst();
            this.method15();
        }

        private void method1(int numD)
        {
            string msg = "";
            if (this.bindingSource2.List.Count > 0)
            {
                if (numD.Equals(1))
                {
                    msg = "是否删除当前计量？";
                }
                else
                {
                    msg = "是否当前计量转下期？";
                }
                if (MsgBox.ShowQuestion(msg) == System.Windows.Forms.DialogResult.OK)
                {
                    base.sqlList.Clear();
                    DHelp.GetObjId(this.bindingSource2);
                    while (this.bindingSource3.List.Count > 0)
                    {
                        this.bindingSource3.RemoveCurrent();
                    }
                    while (this.bindingSource5.List.Count > 0)
                    {
                        this.bindingSource5.RemoveCurrent();
                    }
                    this.bindingSource2.RemoveCurrent();
                    base.Save();
                    this.method7();
                }
            }
        }

        private void method10(int numD)
        {
            DataTable table = base.ds.Tables["QDJL_M"];
            foreach (DataRow row in table.Rows)
            {
                row["SPZT"] = numD;
                row.EndEdit();
            }
        }

        private void method11(object sender, EventArgs e)
        {
            base.Close();
        }

        private void method12(string _str2)
        {
            if (_str2.Equals(""))
            {
                this.bindingSource2.RemoveFilter();
            }
            else
            {
                if (_str2.Contains("*"))
                {
                    _str2 = _str2.Replace("*", "[*]");
                }
                if (_str2.Contains("%"))
                {
                    _str2 = _str2.Replace("%", "[%]");
                }
                string filterExpression = string.Format("QDBH like '%{0}%' or QDMC like '%{0}%'", _str2);
                DataRow[] rowArray = base.ds.Tables["QDJL_MX"].Select(filterExpression);
                string str2 = "";
                foreach (DataRow row in rowArray)
                {
                    if (!str2.Equals(""))
                    {
                        str2 = str2 + ",";
                    }
                    object obj2 = str2;
                    str2 = string.Concat(new object[] { obj2, "'", row["pid"], "'" });
                }
                if (!str2.Equals(""))
                {
                    this.bindingSource2.Filter = "id in (" + str2 + ")";
                }
                else
                {
                    this.bindingSource2.Filter = "id='##$##'";
                }
            }
            this.method16();
        }

        private void method13(object sender, EventArgs e)
        {
            this.method12(this.edtQDBH.Text);
        }

        private void method14(string _str2)
        {
            if (_str2.Equals(""))
            {
                _str2 = DHelp.GetObjValue(this.bindingSource3, "qdbh", false);
            }
            if (_str2.Equals(""))
            {
                _str2 = "000-000-000";
            }
            this.bindingSource1.Filter = "qdbh='" + _str2 + "'";
            if (this.bindingSource1.List.Count == 0)
            {
                Class28.smethod12(base.dsQuery, base.ida, _str2, false);
            }
        }

        private void method15()
        {
            if (this.bindingSource3.List.Count > 0)
            {
                string str = DHelp.GetObjValue(this.bindingSource3, "id", false);
                this.bindingSource4.Filter = "id='" + str + "'";
            }
            else
            {
                this.bindingSource4.Filter = "id='It is Empty'";
            }
        }

        private void method16()
        {
            int position = this.bindingSource3.Position;
            string objId = DHelp.GetObjId(this.bindingSource2);
            this.bindingSource3.Filter = "PID='" + objId + "'";
            this.bindingSource5.Filter = "PID='" + objId + "'";
            if (this.bindingSource3.Position.Equals(position))
            {
                this.method14("");
                this.method15();
            }
            this.ControlFormStatus();
        }

        private void method17(object sender, EventArgs e)
        {
        }

        private void method18(object sender, EventArgs e)
        {
            if (this.bindingSource2.List.Count > 0)
            {
                DataRow dataRow = DHelp.GetDataRow(this.bindingSource2);
                dataRow["SPZT"] = 0;
                dataRow["TYSB"] = 1;
                dataRow.EndEdit();
            }
        }

        private void method2(object sender, DataColumnChangeEventArgs e)
        {
            if (e.Column.ColumnName.Equals("SPZT"))
            {
                if (e.Row["SPZT"].Equals(-1))
                {
                    e.Row["TYSB"] = 0;
                }
                else
                {
                    e.Row["TYSB"] = 1;
                }
                e.Row.EndEdit();
            }
        }

        private void method3(object sender, DataColumnChangeEventArgs e)
        {
            if (e.Column.ColumnName.Equals("BQJLS"))
            {
                decimal num = DHelp.ToDecimal(e.Row["BQJLS"]);
                decimal num2 = DHelp.ToDecimal(e.ProposedValue);
                Class28.smethod13(this.bindingSource1, num2, num);
            }
        }

        private void method4()
        {
            DataTable table = new DataTable();
            table.Columns.Add("code", typeof(int));
            table.Columns.Add("value", typeof(string));
            DataRow row = table.NewRow();
            row["code"] = -1;
            row["value"] = "";
            table.Rows.Add(row);
            row = table.NewRow();
            row["code"] = 0;
            row["value"] = "通过";
            table.Rows.Add(row);
            RepositoryItemLookUpEdit columnEdit = (RepositoryItemLookUpEdit)this.ylcQheaGue.ColumnEdit;
            columnEdit.DataSource = table;
            columnEdit.DisplayMember = "value";
            columnEdit.ValueMember = "code";
        }

        private void method5()
        {
            string str = "";
            base.ds.Clear();
            str = "select * from QDJL_M " + Class28.YfQclfhSo(GParams.QCInfo.QCID, "") + "order by PZBH";
            Class39.smethod4(base.ida, base.ds, str, "QDJL_M", true);
            string str2 = DHelp.GetIds(base.ds.Tables["QDJL_M"], "id", "");
            str = "select * from QDJL_MX where pid in (" + str2 + ")";
            Class39.smethod4(base.ida, base.ds, str, "QDJL_MX", true);
            str = "select * from QDJL_JSS where pid in (" + str2 + ")";
            Class39.smethod4(base.ida, base.ds, str, "QDJL_JSS", true);
            if (base.dsQuery.Tables["QDJL_MX2"] != null)
            {
                base.dsQuery.Tables["QDJL_MX2"].Clear();
            }
            str = "select a.id,a.pid,a.qdbh,b.mc as mc,a.bqjls as sl from qdjl_mx2 a left join zzjgxx b on a.sid=b.id where a.pid in (" + str2 + ")";
            Class39.smethod4(base.ida, base.dsQuery, str, "QDJL_MX2", true);
        }

        private void method6(bool _flag1)
        {
            this.colbqmjls.Visible = _flag1;
            this.colbqmjlje.Visible = _flag1;
            this.colwcbl.Visible = _flag1;
        }

        private void method7()
        {
            if (base.dsQuery.Tables["JLQD"] != null)
            {
                base.dsQuery.Tables["JLQD"].Clear();
            }
            string exeStr = "";
            switch (this.radioGroup.SelectedIndex)
            {
                case 0:
                    exeStr = CHelp.smethod(string.Format(CSQL.JLSPQCQD, GParams._BDID, GParams.QCInfo.QCID));
                    this.method6(false);
                    break;

                case 1:
                    exeStr = CHelp.smethod(string.Format(CSQL._str1, GParams._BDID, GParams.QCInfo.QCID));
                    this.method6(true);
                    break;
            }
            base.dsQuery.Merge(base.ida.ExecuteDataSet(exeStr, CommandType.Text, "JLQD"));
            RoundData();
            this.bindingSource.DataSource = base.dsQuery.Tables["JLQD"];
            if (this.radioGroup.SelectedIndex == 0)
            {
                this.trJLQD.ExpandAll();
            }
        }

        private void RoundData()
        {
            if (base.dsQuery.Tables["JLQD"].Columns.Contains("bqmjlje"))
            {
                foreach (DataRow dr in base.dsQuery.Tables["JLQD"].Rows)
                {
                    if (dr["bqmjlje"] != System.DBNull.Value)
                    {
                        dr["bqmjlje"] = Math.Round(Convert.ToDecimal(dr["bqmjlje"]), 0);
                    }
                }
            }
        }

        private void method8()
        {
            if (this.bindingSource2.List.Count > 0)
            {
                base.Save();
                FrmJLDJSP mjldjsp = new FrmJLDJSP();
                string qdjlid = DHelp.GetObjValue(this.bindingSource2, "ID", false);
                mjldjsp.IniFrm(base.ds, qdjlid);
                mjldjsp.ShowDialog();
                this.method5();
                this.method7();
            }
        }

        private void method9(object sender, EventArgs e)
        {
            this.method8();
        }

        private void radioGroup_SelectedIndexChanged(object sender, EventArgs e)
        {
            this.method7();
        }

        public override void Saving()
        {
            this.edtQDBH.Focus();
            base.Saving();
            this.bindingSource2.EndEdit();
            this.bindingSource3.EndEdit();
        }

        private void trJLQD_CustomDrawNodeCell(object sender, CustomDrawNodeCellEventArgs e)
        {
            if ((e.CellText.ToString().Equals("0") || e.CellText.ToString().Equals("0.00")) || e.CellText.ToString().Equals("0.000"))
            {
                e.CellText = "";
            }
        }

        private void trJLQD_DoubleClick(object sender, EventArgs e)
        {
            if (this.trJLQD.FocusedNode != null && !this.trJLQD.FocusedNode.HasChildren)
            {
                string str = DHelp.GetObjValue(this.bindingSource, "QDMC", false);
                this.edtQDBH.Text = str;
                this.method12(str);
            }
        }
    }
}

